package main

import (
	"fmt"
	"sync"
)

var (
	wg sync.WaitGroup
)

var m2 = sync.Map{}

func main()  {

	for i:=0;i<20;i++{
		wg.Add(1)
		go func(i int) {
			m2.Store(i,i+100)
			value,_ := m2.Load(i)
			fmt.Printf("key: %d val:%d\n",i,value)
			wg.Done()
		}(i)
	}
	wg.Wait()
}
